km=float(input("请输入公里数: "))
if km<=0:
    print("公里数输入错误")
elif km<=3:
    print("您需要付10元车费")
elif km<=10:
    cost = 10+(km-3)*1.2
    print("您需要支付车费: ",cost)
else:
    cost = 10+7*1.2+(km-10)*1.5
    print("您需要支付车费: ",cost)